package org.person.gift.controller;

import org.person.gift.doc.GiftSpuDoc;
import org.person.gift.query.QueryResult;
import org.person.gift.search.GiftSpuSearch;
import org.person.gift.service.IGiftSpuSearchService;
import org.person.gift.util.AjaxResult;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@RequestMapping("/gift/search")
public class GiftSpuSearchController {
    @Autowired
    private IGiftSpuSearchService giftSpuSearchService;

    @PostMapping
    public AjaxResult search(@RequestBody GiftSpuSearch giftSpuSearch){

        QueryResult<GiftSpuDoc> result = giftSpuSearchService.search(giftSpuSearch);
        return AjaxResult.me().setMessage("查询成功").setResultObj(result);
    }
}
